<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .hh {
        opacity: 0;
        pointer-events: none;
        transform: translateY(10px);
        transition: opacity 0.4s ease, transform 0.6s ease-out;
      }
      .hh.active {
        opacity: 1;
        transform: translateY(0);
      }
    </style>
  </head>
  <body>
    <h1 class="hh">123</h1>
    <button>show</button>
    <script>
      /**
       * 通过过渡效果实现
       * **/
      const btn = document.querySelector('button');
      btn.addEventListener('click', function () {
        const hh = document.querySelector('.hh');
        hh.classList.toggle('active');
      });
    </script>
  </body>
</html>
